﻿using System.Drawing.Design;
using ExFlash.Records;
using System.Drawing;

namespace ExFlash.Editors
{
    public class RGBRecordEditor : ColorEditor
    {
        public override void PaintValue(PaintValueEventArgs e)
        {
            RGBRecord rgbRecord = e.Value as RGBRecord;
            
            if (rgbRecord != null)
            {
                Color color = (rgbRecord).GetColor();
                SolidBrush brush = new SolidBrush(color);
                e.Graphics.FillRectangle(brush, e.Bounds);
                brush.Dispose();
            }
        }
    }

    class RGBARecordEditor : ColorEditor
    {
        public override void PaintValue(PaintValueEventArgs e)
        {
            RGBABaseRecord rgbaBaseRecord = e.Value as RGBABaseRecord;
            
            if (rgbaBaseRecord != null)
            {
                Color color = rgbaBaseRecord.GetColor();
                SolidBrush brush = new SolidBrush(color);
                e.Graphics.FillRectangle(brush, e.Bounds);
                brush.Dispose();
            }
        }
    }
}
